package ru.sviridov.sellandbuy;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

/** service for creating new advertising in background and for recieving ads list*/
public class AdvertisingService extends Service{
	public static final String ADS = "ru.sviridov.sellandbuy.ADS";
	public static final String TYPE = "ru.sviridov.sellandbuy.TYPE";
	public static final int TYPE_CREATE = 1;
	public static final int TYPE_GET_LIST = 2;

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
        int taskType = TYPE_CREATE;
        if (intent != null) { //FIXME make clear flags, understand when intent == null
            taskType = intent.getIntExtra(TYPE, TYPE_CREATE);
        }

        switch (taskType) {
            case TYPE_CREATE:
                createAds();
                break;
            case TYPE_GET_LIST:
            	getAdsList();
            	break;
        }

		
		return super.onStartCommand(intent, flags, startId);
	}
	
	private void getAdsList() {
		
	}

	private void createAds() {
		
	}

	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}

}
